define(["block"], function(Block){
    
    return function(spriteBuffer){
        
        this.createBlock = function(sign){
            var block; 
            var frames; 
            if(sign == '.'){
                frames = [spriteBuffer.getSprite(320,0,32,32)];
                block = new Block( frames  );
                block.isUnbreakable = false;
                block.hitPoints = frames.length;
                block.score = 10;
                block.isVisible = true;
                block.isCollidable = block.isVisible;
                return block;                
            }
            else if(sign == '0'){
                frames = [spriteBuffer.getSprite(80,0,32,32)]
                block = new Block( frames );
                block.isUnbreakable = true;
                block.hitPoints = -1;
                block.score = 0;
                block.isVisible = true;
                block.isCollidable = block.isVisible;
                return block;                
            }
            else if(sign == '*'){
                frames = [  spriteBuffer.getSprite(360,0,32,32), 
                            spriteBuffer.getSprite(320,0,32,32) ];
                block = new Block( frames );
                block.isUnbreakable = false;
                block.hitPoints = frames.length;
                block.score = 10; // for each hit
                block.isVisible = true;
                block.isCollidable = block.isVisible;
                return block;
            }
            else if(sign == '#'){
                frames = [  spriteBuffer.getSprite(320,80,32,32), 
                            spriteBuffer.getSprite(360,80,32,32),
                            spriteBuffer.getSprite(0,120,32,32) ];
                block = new Block( frames );
                block.isUnbreakable = false;
                block.hitPoints = frames.length;
                block.score = 15; // for each hit
                block.isVisible = true;
                block.isCollidable = block.isVisible;
                return block;
            }
            else{
                block = new Block( null );  
                block.isUnbreakable = false;
                block.h = 32;
                block.w = 32;
                block.isVisible = false;
                block.isCollidable = block.isVisible;
                return block;
            }
        };
    };
    
});